package com.cainiao.controller;

import com.cainiao.pojo.OperateLog;
import com.cainiao.pojo.Result;
import com.cainiao.service.EmpService;
import com.cainiao.service.StatisticsService;
import com.cainiao.service.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping
/**
 * 报表相关
 */
public class StatisticsController {

    @Autowired
    private StatisticsService statisticsService;
    @Autowired
    private EmpService empService;
    @Autowired
    private StudentService studentService;
    /**
     * 员工岗位分布数据统计
     * @return
     */
    @GetMapping("/report/empJobData")
    public Result empJobData(){
        return Result.success(empService.empJobData());
    }

    @GetMapping("/report/studentDegreeData")
    public Result studentDegreeData(){
        return Result.success(studentService.studentDegreeData());
    }

    @GetMapping("/report/studentCountData")
    public Result studentCountData(){
        return Result.success(studentService.findStudentCountData());
    }

    @GetMapping("/report/empGenderData")
    public Result empGenderData(){
        return Result.success(empService.empGenderData());
    }
    @GetMapping("/log/page")
    public Result page(Integer page, Integer pageSize){
        log.info("page:{},pageSize:{}",page,pageSize);
        return Result.success(statisticsService.page(page,pageSize));
    }
}
